﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MeetIterator
{
    public class DinnerMenu
    {
        static int MAX_ITEMS = 6;
        int numberOfItems = 0;
        MenuItem[] menuItems;

        public Iterator createIterator()
        {
            return new DinnerMenuIterator(menuItems);
        }

        public DinnerMenu()
        {
            menuItems = new MenuItem[MAX_ITEMS];

            AddItem("Vegetarian BLT",
                    @"(Fakin') Bacon lettuce & tomato on whole wheat", true, 2.99);
            AddItem("BLT",
                    @"Bacon with lettuce & tomato on whole wheat", false, 2.99);
            AddItem("Soup of the day",
                    @"Soup of the day, with a side of potato salad", false, 3.29);
            AddItem("Hotdog",
                    @"A hot dog, with saurkraut, relish, onions, topped with cheese", false, 3.05);
        }

        public void AddItem(string name,
            string desciption,
            bool vegetarian,
            double price)
        {
            MenuItem menuItem = new MenuItem(name, desciption, vegetarian, price);
            if (numberOfItems >= MAX_ITEMS)
            {
                Console.WriteLine("sorry, menu is full! can't add more");
            }
            else
            {
                menuItems[numberOfItems] = menuItem;
                numberOfItems++;
            }
        }
    }
}
